home *** CD-ROM | disk | FTP | other *** search
- /* SETDATE.C --- p. 663 */
- #include <stdio.h>
- #include <dos.h>
- main()
- {
- int month, day, year;
- struct date date;
- printf("Enter new date in the form MM/DD/YY:");
- scanf("%d/%d/%d", &month, &day, &year);
- /* Set up the files of the date structure */
- date.da_day = day;
- date.da_mon = month;
- date.da_year = year + 1900;
- /* Set the new date */
- setdate(&date);
- printf("New date: %d/%d/%d\n", date.da_mon,
- date.da_day, date.da_year - 1900);
- }